1. Technical Field
The present invention relates to the field of software, and more particularly, to event handling within servers.
2. Description of the Related Art
Web service providers recognize the need for dynamic content or Web pages that are responsive to user interactions. Such user interactions can involve both client and server-side processing. Client side processing can be useful for allowing small programs, such as applets, to be executed within a user's browser on the user's machine. Server-side programs, however, are often needed for more involved tasks, such as database lookups. In order to perform these server-side tasks, a Web server can act as an interface between a client program, often a browser, and a server program, such as a database.
One of the methods for performing server-side processing involves the use of virtual machines. A virtual machine can be an interface between compiled programming code and a particular hardware platform. Consequently, a virtual machine can allow application programs to be built that can run on any hardware platform without having to be rewritten or recompiled by the programmer for each separate platform. One such virtual machine is a Java virtual machine that can include servlets as compatible server-side programs.
A servlet is a protocol and platform independent server-side component that can utilize a request-response programming model. Each user request handled by a servlet can result in the utilization of a single thread within the processor of the server. Accordingly, servlet processing overhead is slight compared to implementations using a common gateway interface (CGI) which initializes a new process for every user request for which the CGI responds. Notably, a servlet can process client requests in a synchronous manner so that when a client issues a request, the client must wait until the servlet has completed the request. Unfortunately, the client has no way to interrupt or otherwise modify a process executing within the servlet before completion.
For example, a client can submit a request resulting in a server processing a large Voice XML (Voice Extensible Markup Language) document. The server can receive the client request and can utilize a servlet to produce a response. After the servlet has been initiated, however, a “hang up” event occurs making the response moot. Without external event handling capabilities, the servlet will complete the initiated VoiceXML processing even though the “hang up” event renders the response meaningless to the original requesting client. That is, the client may have to wait for a time-out event to occur within the servlet and cannot trigger such an event externally. Accordingly, processing time and server resources can be needlessly wasted.